﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Common;

namespace Fuxi
{
    public partial class FuxiType
    {
        void MakeFlopDecision()
        {
            outs = HandEvaluator.GetNumberOuts(H.MyPocket, F.Board);
            drawing = (outs > 7);
            switch (strategy)
            {
                case StrategyType.Basic:

                    if (winOdds > 0.90 ||
                    winOdds > 0.78 && NumFuxiRaised(G.Flop) == 0 ||
                    H.HavePosition && NumOppRaised(G.Flop) == 0 && winOdds > 0.60 ||
                    !H.HavePosition && NumOppRaised(G.Flop) == 0 && winOdds > 0.70 ||
                    H.HavePosition && NumOppRaised(G.Flop) == 0 && drawing
                    )
                    {
                        ExecuteRaise();
                    }
                    else if (winOdds > 0.60 || drawing)
                    {
                        ExecuteCall();
                    }
                    else
                    {
                        ExecuteCheck();
                    }
                    break;
                case StrategyType.Trap:
                    if (winOdds > 0.75 && isOppCallingStation ||
                        winOdds > 0.6 && winOdds <= 0.75 && NumOppRaised(G.Flop) == 0)
                    {
                        ExecuteRaise();
                    }
                    else if (winOdds > ImpliedPotOdds * 1.2 || drawing)
                    {
                        ExecuteCall();
                    }
                    else
                    {
                        ExecuteCheck();
                    }
                    break;
                case StrategyType.Jackel:
                    if (winOdds > 0.90 ||
                        winOdds > 0.78 && NumFuxiRaised(G.Flop) == 0 ||
                        H.HavePosition && NumOppRaised(G.Flop) == 0 && winOdds > 0.60 ||
                        !H.HavePosition && NumOppRaised(G.Flop) == 0 && winOdds > 0.70 ||
                        NumOppRaised(G.Preflop) > 0 && OppNeverRaised && !isOppCallingStation ||
                        outs > 7 && OppNeverRaised && !isOppCallingStation
                    )
                    {
                        ExecuteRaise();
                    }
                    else if (winOdds > 0.66 || drawing)
                    {
                        ExecuteCall();
                    }
                    else
                    {
                        ExecuteCheck();
                    }
                    break;
                default:
                    break;
            }
        }
    }
}
